import java.util.Scanner;

public class demo01 {
    //美国节日
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int y=sc.nextInt();
            System.out.printf("%d-01-01\n",y);

            int w;
            w=week(y,1,1);
            System.out.printf("%d-01-%02d\n",y,m1(w,3,1));

            w=week(y,2,1);
            System.out.printf("%d-02-%02d\n",y,m1(w,3,1));

            w=week(y,6,1);
            System.out.printf("%d-05-%02d\n",y,m2(w));

            System.out.printf("%d-07-04\n",y);

            w=week(y,9,1);
            System.out.printf("%d-09-%02d\n",y,m1(w,1,1));

            w=week(y,11,1);
            System.out.printf("%d-11-%02d\n",y,m1(w,4,4));

            System.out.printf("%d-12-25\n",y);


            System.out.println();
        }
    }
    public static boolean isLeapYear(int year){
        return (year%400==0)||(year%4==0&&year%100!=0);
    }
    private static final int[] days={31,28,31,30,31,30,31,31,30,31,30,31};
    private static int nDays(int year,int month,int day){
        int n=day;
        for (int i = 0; i < month-1; i++) {
            n+=days[i];
        }
        if(month>2&&isLeapYear(year)){
            n++;
        }
        return n;
    }
    private static int diff(int y,int m,int d){
        return (y-1)+(y-1)/4-(y-1)/100+(y-1)/400+nDays(y, m, d);
    }
    private static int week(int y,int m,int d){
        int w=diff(y,m,d)%7;
        if(w==0){
            w=7;
        }
        return w;
    }
    private static int m1(int w,int n,int e){
        return 1+(n-1)*7+(7-w+e)%7;
    }
    private static int m2(int w){
        int d=(w==1?7:w-1);
        return 32-d;
    }
}
